﻿using System;
using System.Collections.Generic;
using System.Text;
using ProtocolVN.Framework.Core;
using DevExpress.XtraEditors;

namespace ProtocolVN.Framework.Win
{
    public class PhieuPopupFix
    {
        public PhieuPopupFix(PhieuPopupBase phieu) : this(phieu, null) { 
        }
        public PhieuPopupFix(PhieuPopupBase phieu,bool? IsAdd) : this(phieu,null,IsAdd){
        }
        public PhieuPopupFix(PhieuPopupBase phieu, object IDObj,bool? IsAdd){
            phieu.ID = IDObj;
            phieu.IsAdd = IsAdd;
            phieu.errorProvider = new DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider();
            phieu.InitDataControls();
            phieu.InitGridColumns();
            if (!phieu.InitDOData())
                PLMessageBox.ShowNotificationMessage("Dữ liệu không tồn tại. Vui lòng kiểm tra lại.");
        }
    }
}
